package user_db

import (
	database "hft/Database"
	"hft/Database/admin"
)

type UserRegion struct {
	UserID     uint          `json:"user_id"`
	User       *User         `json:"user" gorm:"foreignKey:UserID;references:ID;constraint:OnDelete:CASCADE"`
	RegionID   uint          `json:"region_id"`
	Region     *admin.Region `json:"region" gorm:"foreignKey:RegionID;references:ID;constraint:OnDelete:CASCADE"`
	RegionLink string        `json:"region_link" gorm:"index"`
}

func (UserRegion) TableName() string {
	return database.TableNameFormat("front_user_region")
}
